﻿cmake_minimum_required(VERSION 3.12)
project(detector_test)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_CXX_STANDARD 11) 
add_compile_options("/permissive-")
add_compile_options("/Zc:__cplusplus")

set(CMAKE_AUTOMOC ON)  
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

############### include and build ####################
include_directories("./include")
file(GLOB_RECURSE SOURCEFILES "include/*.h" "src/*.cpp" "resources/*.qrc")	#遍历获取source/路径下所有的*.cpp和*.c文件列表
add_executable(
    ${PROJECT_NAME}
    # WIN32  # 隐藏窗口
    main.cpp
    ${SOURCEFILES}
)


##########  Config Qt6  ##########
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
target_link_libraries(
    ${PROJECT_NAME}
    Qt5::Core
    Qt5::Gui
    Qt5::Widgets
)

 
# ##########  Config OpenCV  ##########
set(OpenCV_PATH E:/opencv/opencv_cuda_4.10.0)
include_directories(${OpenCV_PATH}/include)
link_directories(${OpenCV_PATH}/x64/vc16/lib)
file(GLOB OpenCV_LIBS ${OpenCV_PATH}/x64/vc16/lib/*4100d.lib)
target_link_libraries(${PROJECT_NAME}
        ${OpenCV_LIBS} 
)
